package org.springblade.modules.digitalization.utils;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.utils.Func;

import java.util.ArrayList;
import java.util.List;

//监听器
public class DictListener extends AnalysisEventListener<B01UpLoad> {

    private List<B01UpLoad> upLoads=new ArrayList<>();



    public List<B01UpLoad> getUpLoads(){
        return upLoads;
    }
    //一行一行读取
    @Override
    public void invoke(B01UpLoad b01UpLoad, AnalysisContext analysisContext) {
        //调用方法添加数据库
		if(Func.isBlank(b01UpLoad.getB0101())){
			throw new ServiceException("格式错误");
		}
        upLoads.add(b01UpLoad);
    }
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
